package demo.run;

import core.threadpool.PoolManager;

public class DemoRun {
	public static void main(String[] args) {
		PoolManager poolManeger = new PoolManager(2, 4, 1000) {
			
			@Override
			public void onReject(Runnable r) {
				if (r instanceof DemoThread) {
					System.out.println(((DemoThread) r).name + " reject ");
				}
			}
		};
		
		for (int i = 0; i < 10; i++) {
			DemoThread demoThread = new DemoThread("name" + i);
			poolManeger.execute(demoThread);
		}
	}
}
